package com.atcumt.QiAnXin;

import java.util.Scanner;

/* 
 * 输入样例2
7 2
1 3
2 3
3 3
4 3
5 3
6 3
7 3
输出样例2
29
 */
public class Main03 {
    
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int[][] a = new int[n][m];
        for(int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                a[i][j] = scanner.nextInt();
            }
        }
        int temp = 0, res = 0;
        int[] sum = new int[n];
        for (int i = 0; i < m; i++) {
            for (int j = 0; j < n; j++) {
                temp += a[j][i];
            }
            sum[i] = temp;
            temp = 0;
        }
        for (int i : sum) {
            res = Math.max(res, i);
        }
        if (m == 1) {
            System.out.println(res + 2);
        } else {
            System.out.println(res + 1);
        }
        scanner.close();
    }
}
